<div id="friendchoose" class="pure-form pure-form-stacked">
<div class="at_searchbox"><input id="at_search" class="pure-u-1" oninput="searchUser()" onpropertychange="searchUser()" type="text" placeholder="搜索要@的好友"></div>
<div id="groupusers" class="groupusers">
<php>foreach( $groupusers as $k=>$u){</php>
<ul id="{$k}">
	<li class="ts-listen" data-listen="weibo-at-add" data-at="{$u.uname}"><a href="javascript:void(0);"><img alt="{$u.uname}" src="{$u.avatar_middle}">{$u.uname}</a></li>
</ul>
<php>}</php>
</div>
</div>
<!-- <a class="btn-green-small" style="float:right:marign:0;border:0">确定</a> -->
<script>
function searchUser(){
	$.ajax({
        type:"POST",
        url :U('w3g/Index/SearchUser'),
        data : {'at_search': $('#at_search').val()},
        dataType:"html",
        timeout:10000,
        success:function(r){
            if(r){
                $('#groupusers').html(r);             
            }else{
                $('#groupusers').html(''); 
            }
        },
        error : function(r, type){
            $.ui.showMask('连接服务器失败，请重试', true);
        }
    });
}
// function showgroup(gname,obj,gid){
// 	if ( $('#'+gname+' > li').html() == null ){
// 		$('#groupusers').append('<img src="'+ THEME_URL+'/image/load.gif" id="loadimg" class="alM">');
// 		$.post(U('w3g/Index/changGroup'),{gid:gid},function (res){
// 			$('#loadimg').remove();
// 			if ( res ){
// 				$('#groupusers').append(res);
// 			}
// 		});
// 	}
	
// 	$('#'+gname).show();
// 	$('#g_'+gname).addClass('current');
// 	$('#groups li').removeClass('current');
// 	$(obj).addClass('current');
// 	$('#groupusers ul[id!="'+gname+'"]').hide();
// }
</script>
